﻿@using MC.RideEvent.Mvc.Models.Repository
@using MC.RideEvent.Mvc.Models.ViewModel
@model WayViewModel

<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script type="text/javascript" src="~/Scripts/kendo.web.min.js"></script>

@{
    ViewBag.Title = "Publier un trajet";
    var member = Session["CurrentMember"] as MemberViewModel; 
}

<h2>Publier un traget</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Trajet</legend>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.VehiculeId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Vehicule)
            @Html.TextBox("VehiculeId")
            
            @Html.ValidationMessageFor(model => model.VehiculeId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contribution)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contribution)
            @Html.ValidationMessageFor(model => model.Contribution)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MeetingHour)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MeetingHour)
            @Html.ValidationMessageFor(model => model.MeetingHour)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MeetingPlace)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.MeetingPlace, new {rows = 5, cols = 15})
            @Html.ValidationMessageFor(model => model.MeetingPlace)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.NumberPlaces)
        </div>
        <div class="editor-field">
            @Html.TextBox("NumberPlaces")
        </div>

        <p>
            <input type="submit" value="Ajouter" />
            @Html.Hidden("EventId", Request.QueryString["event"])
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
